.PHONY: all bin doc tar clean

PATHFLAGS = -sourcepath src -classpath bin -d bin

all: bin doc

bin: glucose_static server.jar client.jar

doc:
	javadoc -private -d doc -sourcepath src server.core server.sat client

tar: clean
	cd ..; tar --exclude=.svn -z -c -v -f cs594-project.tar.gz cs594-project/
	mv ../cs594-project.tar.gz .

clean:
	cd src/glucose/core; make clean
	cd bin; rm -rf glucose_static *.jar
	cd doc; rm -rf *
	rm -f cs594-project.tar.gz

glucose_static:
	cd src/glucose/core; make rs
	cp src/glucose/core/glucose_static bin/

server.jar:
	javac src/server/core/Server.java $(PATHFLAGS)
	cd lib; jar -xf mysql-connector-java-5.1.24-bin.jar com
	mv lib/com bin/com
	cd bin; jar -cfe server.jar server.core.Server server com
	rm -rf bin/server bin/com

client.jar:
	javac src/client/SATClient.java $(PATHFLAGS)
	cd bin; jar -cfe client.jar client.SATClient client
	rm -rf bin/client
